package icu.zqyhdm.blog.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import icu.zqyhdm.blog.entity.ArticleTag;
import icu.zqyhdm.blog.mapper.ArticleTagMapper;
import icu.zqyhdm.blog.service.ArticleTagService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description
 * @Author lifu
 * @Date 2021/6/28 15:02
 */
@Service
public class ArticleTagServiceImpl extends ServiceImpl<ArticleTagMapper, ArticleTag> implements ArticleTagService {

    //根据文章id查对应的标签id列表
    @Override
    public List<ArticleTag> getByArticleId(Integer articleId) {
        QueryWrapper<ArticleTag> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("article_id",articleId);
        List<ArticleTag> articleTagList = baseMapper.selectList(queryWrapper);
        return articleTagList;
    }
}
